<template>
  <div id="userLayout" :class="['user-layout-wrapper', device]">
    <div class="container">
      <div class="content top">
        <div class="left">
          <div class="header title">
            <img src="~@/assets/logo-mini.png" class="logo" alt="logo" /> 后台管理系统
          </div>
          <div class="kanban">
            <img src="~@/assets/kanban.png" />
          </div>
        </div>
        <div class="right">
          <route-view />
        </div>
      </div>
      <div class="footer">
        <div class="copyright">
          Copyright @ Lanif All right Reserved.
        </div>
      </div>
    </div>
  </div>
</template>

<script>
import RouteView from './RouteView'
import { mixinDevice } from '@/utils/mixin'

export default {
  name: 'UserLayout',
  components: { RouteView },
  mixins: [mixinDevice],
  data() {
    return {}
  },
  mounted() {
    document.body.classList.add('userLayout')
  },
  beforeDestroy() {
    document.body.classList.remove('userLayout')
  }
}
</script>

<style lang="less" scoped>
#userLayout.user-layout-wrapper {
  height: 100%;

  &.mobile {
    .container {
      .main {
        max-width: 368px;
        width: 98%;
      }
    }
  }

  .container {
    width: 100%;
    min-height: 100%;
    background-color: #ffffff;
    background-image: url('../assets/bg.jpg');
    background-attachment: fixed;
    background-size: cover;
    padding: 110px 0 144px;
    position: relative;

    a {
      text-decoration: none;
    }

    .content {
      width: 80%;
      display: flex;
      margin: 0 auto;
      .left {
        flex: auto;
        width: 50%;
        .kanban {
          text-align: right;
          img {
            width: 70%;
          }
        }
      }
      .right {
        flex: auto;
        width: 50%;
        display: flex;
        align-items: center;
      }
    }

    .top {
      text-align: center;

      .header {
        height: 44px;
        line-height: 44px;

        .badge {
          position: absolute;
          display: inline-block;
          line-height: 1;
          vertical-align: middle;
          margin-left: -12px;
          margin-top: -10px;
          opacity: 0.8;
        }

        .logo {
          height: 44px;
          vertical-align: top;
          border-style: none;
        }
      }
      .title {
        font-size: 31px;
        letter-spacing: 2px;
        font-weight: 600;
        color: #eee;
        margin-top: 28px;
        margin-bottom: 30px;
      }
    }

    .main {
      min-width: 260px;
      width: 368px;
      margin-left: 100px;
    }

    .footer {
      position: absolute;
      width: 100%;
      bottom: 0;
      padding: 0 16px;
      margin: 48px 0 113px;
      text-align: center;

      .copyright {
        color: #999;
        font-size: 14px;
      }
    }
  }
}
</style>
